﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Controls_Reports_MasterAccountOverview : System.Web.UI.UserControl
{
	public BO.MasterAccount MasterAccount { get; set; }

    protected void Page_Load(object sender, EventArgs e)
    {
		if (!IsPostBack)
			LoadData();
    }

	public override void DataBind()
	{
		base.DataBind();

		if (IsPostBack)
		{
			LoadData();
		}
	}

	private void LoadData()
	{
		hlName.Text = MasterAccount.Name;
		hlName.NavigateUrl = AppParams.URLs.MasterAccountPageUrl(MasterAccount.ID);
		lblUsrCount.Text = MasterAccount.OverView.TotalFanCount.ToString();
		lblPostCount.Text = MasterAccount.OverView.TotalPostCount.ToString();
		amLine.ExternalDataFileUrl = "/Service/websiteservice.asmx/MasterAccountTimeLine?ID=" + MasterAccount.ID.ToString();
		lblRequirAction.Visible =MasterAccount.ID%3 == 0;

		lblFbAvgComments.Text = MasterAccount.OverView.FbAvgComments.ToString();
		lblFbComments.Text = MasterAccount.OverView.FbCommentCount.ToString();

		lblTwAvgComments.Text = MasterAccount.OverView.TwAvgReplies.ToString();
		lblTwReplys.Text = MasterAccount.OverView.TwReplyCount.ToString();

	}
}